package com.xunk.equipment.service.mandun.enums;

import com.xunk.equipment.service.mandun.constant.MandunConstant;

/**
 * @ProjectName: xunk
 * @Package: com.xunk.equipment.service.mandun
 * @ClassName: MandunIntervalEnum
 * @Author: luanzhiwei
 * @Description: 曼顿设备区间电量统计查询枚举，年月日时，对应不同查询接口
 * @Date: 2021/3/30 18:42
 * @Version: 1.0
 */
public enum MandunIntervalEnum {

    MONTH("month", MandunConstant.API_GET_BOXES_MON_STATS),
    DAY("day", MandunConstant.API_GET_BOXES_DAY_STATS),
    HOUR("hour", MandunConstant.API_GET_BOXES_HOUR_STATS);
    /**
     * 查询类型
     */
    private String type;
    /**
     * 查询接口
     */
    private String router;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getRouter() {
        return router;
    }

    public void setRouter(String router) {
        this.router = router;
    }

    public static String getRouter(String type) {
        for (MandunIntervalEnum value : MandunIntervalEnum.values()) {
            if (value.getType().equals(type)) {
                return value.getRouter();
            }
        }
        return null;
    }

    MandunIntervalEnum(String type, String router) {
        this.type = type;
        this.router = router;
    }
}
